<script>
import { ref } from 'vue';
export default {

    setup() {
        const count=ref(0)
        const increase=()=>{
            count.value++
        }
        const decrease=()=>{
            count.value--
        }
        return {
          count,increase,decrease
        }
    }

}

</script>
<template>
    <div>
        <h2>{{ count }}</h2>
        <p><button @click="increase">加1</button><button @click="decrease">减1</button></p>
    </div>
</template>